<template>
  <div >
    <div id="toPrint">
      <div class="box">
        <h1>惠州市申报博士津贴汇总表</h1>
        <table class="table" align="center" valign="center" border="1">
          <tr>
            <td rowspan="2" class="top-form top-left">
              填报单位<br>审核意见
            </td>
            <td colspan="7" class="top-form top-right">
              <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;经过我单位审核，以下博士共{{ nub }}人，目前均在惠在岗工作，符合惠州市申报博士津贴条件，同意上报。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;审核人:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2021年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;月（加盖科室公章）</p>
            </td>
          </tr>
        </table>
        <div><br><br></div>
        <table  class="table" align="center" valign="center" border="1">
          <tr class="head">
            <td width="40px">
              序<br>号
            </td>
            <td width="70px">
              姓名
            </td>
            <td width="36px">
              性<br>别
            </td>
            <td width="250px">
              现工作单位及职务
            </td>
            <td width="150px">
              联系手机
            </td>
            <td width="70px">
              申报<br>月数
            </td>
            <td width="100px">
              申报<br>金额
            </td>
            <td width="110px">
              到惠时间
            </td>
            <td>
              备注<br>（请注明在岗/何<br>时何因离惠//新<br>增）
            </td>
          </tr>

          <tr class="body" v-for="item in items">
            <td>{{ item.id }}</td>
            <td>{{ item.reName }}</td>
            <td>{{ item.sex }}</td>
            <td>{{ item.workUnitAndProfession }}</td>
            <td>{{ item.phone }}</td>
            <td>{{ item.nowDiffMonth }}</td>
            <td>{{ item.smallMoney }}</td>
            <td>{{ item.reTime }}</td>
            <td></td>
          </tr>
          <tr class="foot">
            <td colspan="3"><p>填报人:</p></td>
            <td colspan="6"><p>联系电话:</p></td>
          </tr>
        </table>

      </div>
    </div>
    <div>
      <el-button type="primary" v-print="'#toPrint'" @click="prints">打印</el-button>
    </div>

  </div>
</template>

<script>
import {post,get} from "../common/serviceUtil";
export default {
  name: "personalTable",

  data(){
    return{
      items:[],
      index:0,
      nub:0,
    }
  },
  beforeCreate() {

    get("/page/selectAll").then(res=>{
        this.items = res.data.data
        this.nub = this.items.length
        for(let i=0;i<this.items.length;i++){
            this.items[i].id = i+1 ;
        }
    })

  },
  methods:{
    prints(){
      var prints = document.getElementById('toPrint')
      prints.title = "大大大"
    },
    getIndex(){
      return index++
    }
  }
}


</script>

<style scoped>
.box{

}
.table{
  border-collapse: collapse;
  border-spacing: 0;

  display: table;
  width: 100%;
  max-width: 1000px;
  min-width: 1000px;
  margin:0 auto;
  border:  black;
}
.top-form{
  height: 80px;
}
.head>td{
  height: 80px;
}
.body>td{
  height: 40px;
}
.top-right{
  font-size: 22px;
  text-align: left;
}
.top-left{
  width: 100px;
}
.foot{
  text-align: left;
  border: 0px white;
  font-size: 20px;
}
</style>
